package com.itheima.objectStream;

import java.io.*;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Test01 {
    public static void main(String[] args) throws IOException {
        //HashMap<String,String> hashMap = new HashMap<>();
        Properties prop = new Properties();

        FileReader fr = new FileReader("day12_IO\\练习.txt");
        BufferedReader br = new BufferedReader(fr);

        FileWriter fw = new FileWriter("day12_IO\\copy.txt");
        BufferedWriter  bw = new BufferedWriter(fw);
        String line;
        while ((line = br.readLine())!=null){
            String[] split = line.split("\\.");
            prop.setProperty(split[0],split[1]);
        }
//        System.out.println(hashMap);
        prop.store(bw,null);
//        for (Map.Entry<String, String> entry : entries) {
//            bw.write(entry.getKey()+"."+entry.getValue());
//            bw.newLine();
//        }

        bw.close();
        br.close();
        fw.close();
        fr.close();
    }
}
